<?php 
session_start();

//config
$_SITE			= include $_SERVER["DOCUMENT_ROOT"]."/config/site.ini.php";
$_TAG_REPLACE 	= include $_SERVER["DOCUMENT_ROOT"]."/config/tags_replace.ini.php";

//enviroment
$_ENV["obj"]["list"] 	= array('$_DB', '$_USER', '$_ADMIN', '$_TRANSLATE', '$_PAGE');
$_ENV["var"] 			= array('$_SITE' => $_SITE, '$_TAG_REPLACE' => $_TAG_REPLACE);
$_ENV["debug"] 			= array();

//load class
foreach ($_SITE["class"] as $class) {
	include $class;
}

//language
define("LANG_IT", 1);
define("LANG_EN", 2);
$_SESSION["LANGUAGE"] = LANG_IT;

//connect DB
$_DB = new DataBase($_SITE["db"]["host"], $_SITE["db"]["name"], $_SITE["db"]["user"], $_SITE["db"]["pass"]);
$_DB->setPrefix($_SITE["db"]["prefix"]);
$_DB->connect();

//load user login
$_USER = new User();
$_USER->authentication();

$_ADMIN = new admin();
$_TRANSLATE = new Translator();

?>